<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>铜丝空闲盘智能分选</title>

    <link rel="stylesheet" href="../css/MyHome.css">
    <link rel="stylesheet" href="../layui-v2.6.8/layui/css/layui.css">
    <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
</head>

<body>
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo layui-hide-xs layui-bg-black">智能分选</div>

            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item layui-hide layui-show-md-inline-block">
                    <a href="javascript:;">
                        <p>文智伟</p>
                    </a>
                    <dl class="layui-nav-child">
                        <dd><a href="My.html">个人信息</a></dd>
                        <dd><a href="Login.html">退出</a></dd>
                    </dl>
                </li>
            </ul>
        </div>

        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item layui-nav-itemed">
                        <a class="" href="MyHome.html">首页</a>
                    </li>
                    <li class="layui-nav-item">
                        <a href="Person.html">人员管理</a>
                    </li>
                    <li class="layui-nav-item"><a href="Work.html">问题反馈</a></li>
                    <li class="layui-nav-item"><a href="My.html">个人信息</a></li>
                    <li class="layui-nav-item"><a href="mypaner.html">员工手册</a></li>
                </ul>
            </div>
        </div>

        <div class="layui-body">
            <!-- 内容主体区域 -->
            <div style="padding: 15px;" class="myTop">
                <fieldset class="layui-elem-field layui-field-title">
                    <legend>
                        <h3>首页信息</h3>
                    </legend>
                </fieldset>
                <div class="layui-carousel" id="test1" lay-filter="test1">
                    <div carousel-item="" class="allOver">
                        <div><img src="../img/01.jpg"></div>
                        <div><img src="../img/02.jpg"></div>
                        <div><img src="../img/03.jpg"></div>
                        <div><img src="../img/04.jpg"></div>
                        <div><img src="../img/05.jpg"></div>
                    </div>
                </div>


                <fieldset class="layui-elem-field">
                    <legend>工人基本信息</legend>
                    <div class="layui-field-box">
                        <table class="layui-hide" id="demo"></table>
                    </div>
                </fieldset>

                <fieldset class="layui-elem-field">
                    <legend>车间基本信息</legend>
                    <div class="layui-field-box">
                        <div id="main" style="width: 600px;height:400px; float: left;"></div>
                        <div id="main2" style="width: 600px;height:400px;float: left;"></div>
                    </div>
                </fieldset>
            </div>
        </div>
    </div>
    <script src="../js/MyHome.js"></script>
    <script src="../layui-v2.6.8/layui/layui.js"></script>
    <script>
        // 基于准备好的dom，初始化echarts实例
        var myChart2 = echarts.init(document.getElementById('main2'));

        // 指定图表的配置项和数据
        var option2 = {
            title: {
                text: '二号车间'
            },
            tooltip: {},
            legend: {
                data: ['销售']
            },
            xAxis: {
                data: ["P5", "P6", "P7", "P8", "P9", "P3"]
            },
            yAxis: {},
            series: [{
                name: '销售',
                type: 'bar',
                data: [550, 700, 360, 100, 100, 200]
            }]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart2.setOption(option2);

        // 基于准备好的dom，初始化echarts实例
        var myChart = echarts.init(document.getElementById('main'));

        // 指定图表的配置项和数据
        var option = {
            title: {
                text: '一号车间'
            },
            tooltip: {},
            legend: {
                data: ['销售']
            },
            xAxis: {
                data: ["P5", "P6", "P7", "P8", "P9", "P3"]
            },
            yAxis: {},
            series: [{
                name: '销售',
                type: 'bar',
                data: [50, 200, 360, 100, 100, 200]
            }]
        };

        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);
        layui.use(['carousel', 'form'], function () {
            var carousel = layui.carousel
                , form = layui.form;

            //常规轮播
            carousel.render({
                elem: '#test1'
                , arrow: 'always', width: '800px'
                , height: '280px'
            });

            //改变下时间间隔、动画类型、高度
            carousel.render({
                elem: '#test2'
                , interval: 1800
                , anim: 'fade'
                , height: '120px'
            });
            var $ = layui.$, active = {
                set: function (othis) {
                    var THIS = 'layui-bg-normal'
                        , key = othis.data('key')
                        , options = {};

                    othis.css('background-color', '#5FB878').siblings().removeAttr('style');
                    options[key] = othis.data('value');
                    ins3.reload(options);
                }
            };

            //监听开关
            form.on('switch(autoplay)', function () {
                ins3.reload({
                    autoplay: this.checked
                });
            });

            $('.demoSet').on('keyup', function () {
                var value = this.value
                    , options = {};
                if (!/^\d+$/.test(value)) return;

                options[this.name] = value;
                ins3.reload(options);
            });

        });
        //JS 
        layui.use(['element', 'layer', 'util'], function () {
            var element = layui.element
                , layer = layui.layer
                , util = layui.util
                , $ = layui.$;

            //头部事件
            util.event('lay-header-event', {
                //左侧菜单事件
                menuLeft: function (othis) {
                    layer.msg('展开左侧菜单的操作', { icon: 0 });
                }
                , menuRight: function () {
                    layer.open({
                        type: 1
                        , content: '<div style="padding: 15px;">处理右侧面板的操作</div>'
                        , area: ['260px', '100%']
                        , offset: 'rt' //右上角
                        , anim: 5
                        , shadeClose: true
                    });
                }
            });

        });
    </script>
</body>

</html>